package demo1;

import java.util.ArrayList;

public class Text {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        //System.out.println(list);
        //增
        list.add("abc");
        list.add("def");
        list.add("ghi");
        list.add("jkl");
        //删
        /*list.remove("abc");
        list.remove(1);*/
        //改
        //list.set(0,"abc");
        //查
        /*String s = list.get(i);
        System.out.println(s);*/
        System.out.print("[ ");
        for (int i = 0; i < list.size(); i++) {
            if(i < list.size()-1){
                System.out.print(list.get(i) + ", ");
            }else {
                System.out.print("]");
            }
        }
    }
}
